package top.juntech.msweatherreport.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import top.juntech.msweatherreport.client.WeatherDataClient;
import top.juntech.msweatherreport.service.WeatherReportService;
import top.juntech.msweatherreport.vo.Weather;
import top.juntech.msweatherreport.vo.WeatherResponse;

@Service
public class WeatherReportServiceImpl implements WeatherReportService {

    @Autowired
    WeatherDataClient weatherDataClient;
    @Override
    public Weather getDataByCityId(@PathVariable("cityId") String cityId) {

        WeatherResponse weatherResp = weatherDataClient.getDataByCityId(cityId);
        return weatherResp.getData();

    }
}
